﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../lib/html5.js"></script>
    <script type="text/javascript" src="../lib/respond.min.js"></script>
    <script type="text/javascript" src="../lib/PIE_IE678.js"></script>
    <![endif]-->
    <link href="../lib/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->

    <title>基地到货时长管理</title>
</head>
<body>
    <div class="pd-20">
        <form id="itemEdit" name="itemEdit" method="post" action="../ashx/spui.ashx" class="form form-horizontal">
            <input type="hidden" class="actionValue" id="editAction" name="action" value="add" />
            <input type="hidden" id="id" name="id" />
            <input type="hidden" id="tablename" name="tablename" value="" />
            <input type="hidden" id="tablemidname" name="tablemidname" value="" />
            <input type="hidden" id="dataneedtouser" name="dataneedtouser" value="1" />
            <!--<input type="hidden" id="hcrainsettype" name="hcrainsettype" value="2" />--><!--贴码分析-->
            <input type="hidden" name="fstartcodes" id="fstartcodes" />
            <input type="hidden" name="fstartcoden" id="fstartcoden" />
            <input type="hidden" name="fstartcodel" id="fstartcodel" />
            <input type="hidden" name="fendcodes" id="fendcodes" />
            <input type="hidden" name="fendcoden" id="fendcoden" />
            <input type="hidden" name="fendcodel" id="fendcodel" /><input type="hidden" name="fcodecount" id="fcodecount" />
            
            <!--是否要包含通用数据必归属处理-->
            <input type="hidden" id="ywcheckonly" name="ywcheckonly" value="fstartcode#当前编号已存在!" />
            <!--唯一性检查 所用字段要在表单中-->
            <div>
                <a href="javascript:;" onclick="toolAddMain('发货明细记录','../hsctask/sctaskOutToCenterDay.html')" class="btn btn-success  radius"><i class="Hui-iconfont">&#xe681;</i> 查看各基地发货明细记录</a>
            </div>
            <div class="row cl">
                <label class="form-label col-2">基地：</label>
                <div class="formControls col-2 layui-form">
                    <select class="select" size="1" name="selectftaskfromorgid" id="selectftaskfromorgid" lay-filter="selectftaskfromorgid">
                        <option value="">直接选择或搜索选择</option>
                    </select>
                </div>
                <input type="hidden" name="ftaskfromorgid" id="ftaskfromorgid" />
                <div class="formControls col-3">
                    <input type="text" class="input-text" name="ftaskfromorgname" id="ftaskfromorgname" readonly="true" style="background-color: #cccccc;" />
                </div>

                <label class="form-label col-2"><span class="c-red">*</span>入库日期：</label>
                <div class="formControls col-2">
                    <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked: function () { loadworkDcinfo(); }})" placeholder="入库时间" id="ftaskworktime" name="ftaskworktime" class="input-text Wdate" placeholder="不能为空">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>地块：</label>
                <div class="formControls col-3  layui-form">
                    <select name="selectdc" id='selectdc' lay-filter="selectdc" lay-search="">
                        <option value="">直接选择或搜索选择</option>
                    </select>
                    <input type="hidden" name="fdkid" id="fdkid" />
                </div>
                <div class="formControls col-5">
                    <input type="text" class="input-text" name="fdkname" id="fdkname" readonly="true" style="background-color: #cccccc;" />
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>任务：</label>
                <div class="formControls col-3  layui-form">
                    <select name="selecttaskinfo" id='selecttaskinfo' lay-filter="selecttaskinfo" lay-search="">
                        <option value="">直接选择或搜索选择</option>
                    </select>
                    <input type="hidden" name="ftaskid" id="ftaskid" /> <input type="hidden" name="fcsgetpc" id="fcsgetpc" />
                </div>
                <div class="formControls col-5">
                    <input type="text" class="input-text" name="ftaskno" id="ftaskno" readonly="true" style="background-color: #cccccc;" nullmsg="任务" datatype="*1-40" />
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>品种：</label>
                <div class="formControls col-3  layui-form" style="display: none;">
                    <select name="slectpj" id='slectpj' lay-filter="slectpj" lay-search="">
                        <option value="">直接选择或搜索选择</option>
                    </select>
                    <input type="hidden" name="fproductid" id="fproductid" />
                </div>
                <div class="formControls col-5">
                    <input type="text" class="input-text" name="fproductname" id="fproductname" readonly="true" style="background-color: #cccccc;" nullmsg="品种" datatype="*2-20" />
                </div>
            </div>


            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>开始编号：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" placeholder="开始编号" id="fstartcode" name="fstartcode" nullmsg="开始编号" datatype="*2-20">
                </div>
                <div class="col-1"></div>
                <label class="form-label col-2"><span class="c-red">*</span>结束编号：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" placeholder="结束编号" id="fendcode" name="fendcode" nullmsg="结束编号" datatype="*2-20">
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <div class="formControls col-2"></div>
                <div class="formControls  skin-minimal col-10">
                    <div class="check-box">
                        <input type="checkbox" id="c_dcinfo" name="c_dcinfo" value="1" checked="checked" />
                        <label for="ffv71">自动加载库存有机码，并强制分析当前有机码是否在库，及可用</label>
                    </div>
                </div>
            </div>
            <div class="row cl">
                <div class="col-6 col-offset-4">
                    <button class="btn btn-primary radius" type="submit" id="btsub1">提交</button>&nbsp;&nbsp;
                    <button class="btn btn-secondary radius" type="button" id="btn_reset">重置</button>&nbsp;&nbsp;
                    <button onclick="layer_close();" class="btn btn-default radius" type="button">返回</button>
                </div>
            </div>
        </form>
    </div>


    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layui/layui.js"></script>
    <script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="../lib/Validform/5.3.2/Validform.js"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_au.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        spsetBaseNoBt("hsc_task_process_workok_code", "id", "hsc_task_process_workok_code as T", "*", "#tablelist", "baseinfo11", "品种出成率管理", "baseinfo11");
        $("#ftaskworktime").val(new Date().Format("yyyy-MM-dd"));
        var loadcode_orgid = 0;
        var loadcode_productid = 0;
        //HcUiAuloadInfoAuto = false;//将自动加载，设置为false（禁用自动加载）
        var loadisOk = 1;
        hcui_ajaxasync = false;//禁用异步，先加载下拉信息
        var uiform = null;
        var selectTaskInfo = [];
        $(function () {
            //基地
            layui.use(['form'], function () {
                uiform = layui.form();
                hcdoselbyPost("BranchID as id,BranchName as name", "mrbranch", "type='本部'", "", "", "id",
                 function (data) {
                     SetSelectWithArrayIdName("#selectftaskfromorgid", data);
                     // if (uiform) uiform.render('select');
                 });
                hcdoselbyPost("id,fv1 as name", "yw_baseinfo", "type='1' and  maintype='1'", "", "", "id",
                 function (data) {
                     SetSelectWithArrayIdName("#slectpj", data);
                     // if (uiform) uiform.render('select');
                 });

                if (uiform) uiform.render('select');
                uiform.on('select(selectftaskfromorgid)', function (data) {
                    $('#ftaskfromorgid').val(data.value);
                    $('#ftaskfromorgname').val($("#selectftaskfromorgid").find("option:selected").text());
                    //加载基地 地块
                    //地块信息
                    loadworkDcinfo();
                    //hcdoselbyPost("id,concat(fv4,'-',fv1,'-',fv8,'-',fv9,'-',fv6) as name", "yw_baseinfo", "type=2 and maintype=2 and databranchid=" + data.value, "", "", "id",
                    //       function (data) {
                    //           SetSelectWithArrayIdName("#selectdc", data);
                    //           if (uiform) uiform.render('select');
                    //       });
                });
                //uiform.on('select(ftaskfromorgid)', function (data) {
                //    $('#fdkid').val("0");
                //    $('#fdkname').val("");
                //    //加载基地 地块
                //    //地块信息
                //    loadworkDcinfo();
                //});
                uiform.on('select(selectdc)', function (data) {
                    $('#ftaskid').val(""); $('#ftaskno').val("");
                    $('#fdkid').val(data.value);
                    $('#fdkname').val($("#selectdc").find("option:selected").text());
                    $('#fproductname').val("");
                    $('#fproductid').val("");
                    //任务信息
                    hcdoselbyPost("taskid as id,concat(dkname,'-',productname,'-',taskno) as name,dkid,productid,productname,taskfromorgid,csgetpc", "hsc_task_store", " inouttype='采摘入库' and  dataaddtime>='" + $('#ftaskworktime').val() + " 00:00:00' and  dataaddtime<='" + $('#ftaskworktime').val() + " 23:59:59' and   dkid=" + data.value, "", "", "id",
                           function (data) {
                               selectTaskInfo = data;
                               data.splice(0, 0, { "id": "0", "name": "不指定任务" });
                               SetSelectWithArrayIdName("#selecttaskinfo", data);
                               //默认加第2个
                               if (data.length > 1) {
                                   $('#selecttaskinfo').val(selectTaskInfo[1].id);
                                   $('#ftaskid').val(selectTaskInfo[1].id);
                                   $('#ftaskno').val(selectTaskInfo[1].name);
                                   $('#slectpj').val(hcgetJsonObjById(selectTaskInfo, selectTaskInfo[1].id).productid);
                                   $('#fproductname').val(hcgetJsonObjById(selectTaskInfo, selectTaskInfo[1].id).productname);
                                   $('#fproductid').val(hcgetJsonObjById(selectTaskInfo, selectTaskInfo[1].id).productid);
                                   $('#fcsgetpc').val(hcgetJsonObjById(selectTaskInfo, selectTaskInfo[1].id).csgetpc);
                                   loadcode_orgid = selectTaskInfo[1].taskfromorgid;
                                   loadcode_productid = selectTaskInfo[1].productid;
                                   if ($("#c_dcinfo").is(':checked')) loadcodedefaultinfo(loadcode_orgid,
                                      loadcode_productid, 1);
                               }

                               if (uiform) uiform.render('select');
                           });

                });
                uiform.on('select(slectpj)', function (data) {
                    $('#fproductid').val(data.value);
                    $('#fproductname').val($("#slectpj").find("option:selected").text());
                });
                uiform.on('select(selecttaskinfo)', function (data) {
                    $('#ftaskid').val(data.value);
                    $('#ftaskno').val(hcgetJsonObjById(selectTaskInfo, data.value).name);
                    $('#slectpj').val(hcgetJsonObjById(selectTaskInfo, data.value).productid);
                    $('#fproductname').val(hcgetJsonObjById(selectTaskInfo, data.value).productname);
                    $('#fproductid').val(hcgetJsonObjById(selectTaskInfo, data.value).productid);
                    $('#fcsgetpc').val(hcgetJsonObjById(selectTaskInfo, data.value).csgetpc);
                    loadcode_orgid = hcgetJsonObjById(selectTaskInfo, data.value).taskfromorgid;
                    loadcode_productid = hcgetJsonObjById(selectTaskInfo, data.value).productid;
                    if ($("#c_dcinfo").is(':checked')) loadcodedefaultinfo(loadcode_orgid,
                       loadcode_productid, 1);
                });
            });
        });
        //加载处理
        function loadin() {

        }

        //加载默认的有机码

        function loadcodedefaultinfo(taskfromorgid, productid, storeallbcount) {

            if (taskfromorgid) {
                hcapiget("../api/Hcrain/GetOutCodeList", { "gjid": 150, "spid": productid, "count": storeallbcount }, function (backdata) {
                    backdata.forEach(function (ee) {
                        if (ee.startCode) {
                            $('#fstartcode').val(ee.startCode); $('#fendcode').val(ee.endCode);
                        }

                    });

                });
            }
        }
        //加载采收信息
        function loadworkDcinfo() {
            if ($('#ftaskfromorgid').val()) {
                hcdoselbyPost("id,concat(fv4,'-',fv1,'-',fv8) as name", "yw_baseinfo",
                    "type=2 and maintype=2 and databranchid=" + $('#ftaskfromorgid').val() + " and id in(SELECT dkid from hsc_task_store where databranchid=" + $('#ftaskfromorgid').val() + " and inouttype='采摘入库' and  dataaddtime>='" + $('#ftaskworktime').val() + " 00:00:00' and  dataaddtime<='" + $('#ftaskworktime').val() + " 23:59:59' GROUP BY dkid )", "", "", "id",
                               function (data) {
                                   if (data.length == 0) {
                                       layer.msg('当前机构+采收日期，没找到对应的采收记录', { icon: 3 });
                                   }
                                   SetSelectWithArrayIdName("#selectdc", data);

                                   if (uiform) uiform.render('select');
                               });
            }
            else { }
        }
        //重写  提交前数据处理
        function hcrBeforeSub() {
            hcui_ajaxasync = false;
            if ($("#fstartcode").val().length != $("#fstartcode").val().length) {
                layer.msg('开始码与结束码,长度不一致', { icon: 2 });
                return false;
            }
            if ($('#fcsgetpc').val()=="") {
                layer.msg('采收批次，没有加载成功，请重试（重试后还是不行，请联系管理人员）', { icon: 2 });
                return false;
            }
            hcapiget("../api/Hcrain/GetCodeNum", { "codeinfo": $("#fstartcode").val() }, function (data) {
                $("#fstartcodes").val(data.codestring);
                $("#fstartcoden").val(data.codenum);
                $("#fstartcodel").val(data.codenuml);
            });
            hcapiget("../api/Hcrain/GetCodeNum", { "codeinfo": $("#fendcode").val() }, function (data) {
                $("#fendcodes").val(data.codestring);
                $("#fendcoden").val(data.codenum);
                $("#fendcodel").val(data.codenuml);
            });

            //分析--开始码与结束码 非数值部分一致
            if ($("#fstartcodes").val() != $("#fendcodes").val()) {
                layer.msg('开始码与结束码,不是同一个号段噢', { icon: 2 });
                return false;
            }
            //分析--开始码与结束码 的数值结束的要是数值
            if (($("#fstartcodel").val() * 1) <= 0) {
                layer.msg('号段应该以数值结尾', { icon: 2 });
                return false;
            }
            //分析--开始码与结束码 的数值结束的要》=开始的
            if (($("#fendcoden").val() * 1) < ($("#fstartcoden").val() * 1)) {
                layer.msg('结束码应该大于等于开始码', { icon: 2 });
                return false;
            }
            var isPass = false;
            if (getUrlParam("action") == "add") {//新增库存分析
                if ($("#c_dcinfo").is(':checked')) {
                    hcui_ajaxasync = false;
                   
                    hcapipost("../api/Hcrain/PostCheckCodeListIsOk", [{ startCode: $('#fstartcode').val(), endCode: $('#fendcode').val() }], function (data) {
                        if (data != "1") {
                            layer.msg(data, { icon: 2 }); isPass = false;
                        }
                        else { isPass = true; }
                    });

                    if (isPass == false)
                    { return false; }
                }
            }
            else {
                $("#fcodecount").val($("#fendcoden").val()*1-$("#fstartcoden").val()*1+1);

                //修改分析及库存回填 只能少 不能多
                //分析--开始码与结束码 长度一致

                //Mhcloadback[0] = "startcode";
                //Mhcloadback[1] = "startcodes";
                //Mhcloadback[2] = "startcoden";
                //Mhcloadback[3] = "startcodel";
                //Mhcloadback[4] = "endcode";
                //Mhcloadback[5] = "endcodes";
                //Mhcloadback[6] = "endcoden";
                //Mhcloadback[7] = "endcodel";
                if ($("#fstartcode").val().length != loadbackdata.startcode.length) {
                    layer.msg('修改后的号段，与原有号段不一致1', { icon: 2 });
                    return false;
                }
                if ($("#fstartcodes").val().length != loadbackdata.startcodes.length) {
                    layer.msg('修改后的号段，与原有号段不一致2', { icon: 2 });
                    return false;
                }
                if (($("#fstartcoden").val() * 1) < (loadbackdata.startcoden * 1)) {
                    layer.msg('修改后的开始号必须大于或等于原有的开始号', { icon: 2 });
                    return false;
                }
                if (($("#fendcoden").val() * 1) > (loadbackdata.endcoden * 1)) {
                    layer.msg('修改后的结束号必须小于或等于原有的结束号', { icon: 2 });
                    return false;
                }

                if (($("#fstartcoden").val() * 1) > (loadbackdata.startcoden * 1)) {
                    //要回库的前号段
                    var addinfo = "type%20171015$typename%有机码$maintype%20171015$fv1%" + HCUser.HCUorg
                     + "$fv2%" + HCUser.HCUorgName
                     + "$fv3%" + loadbackdata.productid
                     + "$fv4%" + $("#fproductname").val()
                     + "$fv5%" + loadbackdata.startcode
                     + "$fv6%" + ((loadbackdata.startcodes + "") + get0string(loadbackdata.startcode.length * 1 - (($("#fstartcoden").val() * 1 - 1) + "").length * 1 - (loadbackdata.startcodes + "").length) + (($("#fstartcoden").val() * 1 - 1) + ""))
                     + "$fv7%" + loadbackdata.startcodes
                     + "$nv1%" + loadbackdata.startcoden
                     + "$nv2%" + loadbackdata.startcodel
                     + "$nv3%" + ($("#fstartcoden").val() * 1 - 1)
                     + "$nv4%" + loadbackdata.startcodel
                     + "$nv5%" + (($("#fstartcoden").val() * 1) - loadbackdata.startcoden)
                     + "$dataaddtime%2000-01-01";
         
                    hcdoadd2017("yw_baseinfo", addinfo, 2, "", function (info) {
                        if (info == "ok") {
                            isPass = true;
                        }
                        else {
                            layer.msg("回库处理失败1" + info, { icon: 2 });
                            isPass = false;
                        }
                    });
                    if (isPass == false)
                    { return false; }
                }

                if (($("#fendcoden").val() * 1) < (loadbackdata.endcoden * 1)) {
                    //要回库的后号段
                    var addinfo = "type%20171015$typename%有机码$maintype%20171015$fv1%" + HCUser.HCUorg
                     + "$fv2%" + HCUser.HCUorgName
                     + "$fv3%" + loadbackdata.productid
                     + "$fv4%" + $("#fproductname").val()
                     + "$fv5%" + ((loadbackdata.startcodes + "") + get0string(loadbackdata.startcode.length * 1 - (($("#fendcoden").val() * 1 + 1) + "").length * 1 - (loadbackdata.startcodes + "").length*1) + (($("#fendcoden").val() * 1 + 1) + ""))
                     + "$fv6%" + loadbackdata.endcode
                     + "$fv7%" + loadbackdata.startcodes
                     + "$nv1%" + ($("#fendcoden").val() * 1 + 1)
                     + "$nv2%" + loadbackdata.startcodel
                     + "$nv3%" + loadbackdata.endcoden 
                     + "$nv4%" + loadbackdata.startcodel
                     + "$nv5%" + (loadbackdata.endcoden * 1 - ($("#fendcoden").val() * 1))
                     + "$dataaddtime%2000-01-01"   ;

                    hcdoadd2017("yw_baseinfo", addinfo, 2, "", function (info) {
                        if (info == "ok") {
                            isPass = true;
                        }
                        else {
                            layer.msg("回库处理失败1" + info, { icon: 2 });
                            isPass = false;
                        }
                    });
                    if (isPass == false)
                    { return false; }
                }

                

            }


            // $("#ftaskfromorgname").val($('#ftaskfromorgid option:selected').text());
        }
        function get0string(len) {
            var re = "";
            for (var i = 0; i < len; i++) {
                re = re + "0";
            }
            return re;
        }

        Mhcloadback[0] = "startcode";
        Mhcloadback[1] = "startcodes";
        Mhcloadback[2] = "startcoden";
        Mhcloadback[3] = "startcodel";
        Mhcloadback[4] = "endcode";
        Mhcloadback[5] = "endcodes";
        Mhcloadback[6] = "endcoden";
        Mhcloadback[7] = "endcodel"; Mhcloadback[8] = "productid";
        
        var loadbackdata = [];
        function loadback(data) {
            // uiform.render();//这个不能去掉,坑啊
            loadbackdata = data;
        }

        //通用标准的toolAdd
        function toolAddMain(t, url, w, h) {
            if (url == null || url == '') {
                url = spPageHtmlName + "-ae.html?action=add";
            };
            if (t == null || t == '') {
                t = "新增" + pPageInfoName + "信息";
            };

            if (w == null || w == '' || w == 'undefined') {
                var index = parent.layer.open({
                    type: 2,
                    title: t,
                    content: url,

                    end: function () {
                        findreolad("sdivclosed");
                    }
                });
                parent.layer.full(index);
            }
            else {
                if (w == null || w == '') {
                    w = 800;
                };
                if (h == null || h == '') {
                    h = ($(window).height() - 50);
                };
                layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false,
                    maxmin: true,
                    shade: 0.4,
                    title: t,
                    content: url,
                    end: function () {
                        findreolad("sdivclosed");
                    }
                });

            }
        }
        //提交数据后,回调
        function subback(data) {
            hcui_ajaxasync = false;
            if (data.status == "y") {
               

                if (getUrlParam("action") == "add") {//新增
                    if ($("#fgid")) { $("#fgid").val(NewGuid()); }

                    if ($("#c_dcinfo").is(':checked')) {
                        hcapipost("../api/Hcrain/PostOutCodeListIsOk", [{ startCode: $('#fstartcode').val(), endCode: $('#fendcode').val() }], function (data2) {
                            if (data2 != "1") {
                                layer.msg("登记成功，但同步失败。" + data2, { icon: 2 });
                            }
                            else {
                                layer.msg(data.info + "--并加载下一段有机码", { icon: 6, time: 1600 });
                                loadcodedefaultinfo(loadcode_orgid,
                                           loadcode_productid, 1);
                            }
                        });
                    }
                    else {
                        layer.msg(data.info, { icon: 6, time: 1600 });

                    }
                }
                else {
                    //更新

                    loadbackdata.startcode = $("#fstartcode").val();
                    loadbackdata.startcodes = $("#fstartcodes").val();
                    loadbackdata.startcoden = $("#fstartcoden").val();
                    loadbackdata.startcodel = $("#fstartcodel").val();
                    loadbackdata.endcode = $("#fendcode").val();
                    loadbackdata.endcodes = $("#fendcodes").val();
                    loadbackdata.endcoden = $("#fendcoden").val();
                    loadbackdata.endcodel = $("#fendcodel").val();

                    //修改
                    layer.msg(data.info, { icon: 6, time: 1600 });
                }

            }
            else {
                layer.alert(data.info, { icon: 2 });
            }

        }
    </script>
</body>
</html>
